package io;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;

public class OOSDemo {
    public static void main(String[] args) throws IOException {
        String nane = "刘桑";
        int age = 55;
        String gender = "男";
        String[] otherInof = {"技术好","拍片儿一流","头发少"};
        Person p = new Person(nane,age,gender,otherInof);

        FileOutputStream fos = new FileOutputStream("person.obj");
        ObjectOutputStream oos = new ObjectOutputStream(fos);

        oos.writeObject(p);
        System.out.println("写出完毕！");
        oos.close();
    }
}
